import request from "../utils/request"

export function selectPage (current,size,user) {
  return request({
        url: '/user/selectPage',
        methods: 'get',
        params:{
          current,
          size,
          user,
        }
    })
}

export function selectDeptList () {
  return request({
    url: '/tb-department/selectDeptList',
    method: 'get',
  })
}

export function insertUser (iUser) {
  return request({
    url: '/user/insertUser',
    method: 'post',
    data: iUser,
  })
}

export const deleteImgFile= (file) => {
  return request({
    url: "/aliOss/deleteImgFile",
    method: 'post',
    params: {
      file
    }
  })
}

export function getUpdate (id) {
  return request({
    url: "/user/getUpdate",
    method: "get",
    params:{
      id,
    }
  })
}

export function deleteUser (id) {
  return request({
    url: "/user/delUser",
    method: "delete",
    params:{
      id,
    }
  })
}

export function updateUser (uUser) {
  return request({
    url: '/user/updateUser',
    method: 'put',
    data: uUser,
  })
}

export function exportUserInfo (uUser) {
  return request({
    url: '/user/export',
    method: 'post',
    data: uUser,
    responseType: "blob"
  })
}

export function updateStatus (id,status) {
  return request({
    url: '/user/updateStatus',
    method: 'put',
    params:{
      id,
      status
    }
  })
}


export function getSendSms (phonse) {
  return request({
    url: '/user/getSendSms',
    method: 'get',
    params:{
      phonse
    }
  })
}


export function outLogin () {
  return request({
    url: '/logout',
    method: 'get',
  })
}

export function getDeptEcharts () {
  return request({
    url: '/tb-department/getDeptEcharts',
    method: 'get',
  })
}
